package com.tenebrous.jestic.controller.framwork.acom;

import com.tenebrous.jestic.controller.SupperController;
import com.rain.ops.sdk.dto.ApiResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 回调
 */
@Slf4j
@RestController
@RequestMapping("/common/callback")
public class CallbackController extends SupperController {

    @PostMapping("/listener")
    public ApiResult listener(HttpServletRequest request, HttpServletResponse response) {
        System.out.println("监听器接口回调...");
        String taskid = request.getParameter("taskid");
        String actDefid = request.getParameter("actDefid");
        String procDefid = request.getParameter("procDefid");
        String procInstid = request.getParameter("procInstid");

        System.out.println(taskid);
        System.out.println(actDefid);
        System.out.println(procDefid);
        System.out.println(procInstid);

        return new ApiResult(200, "调用成功。");
    }
}
